<script type="text/javascript">
var javatar_upload = $('#img_upload');
javatar_upload.on('change', function(e) {
	var files = xn.get_files_from_event(e);
	xn.upload_file(
		files[0], 
		xn.url('upload_image'), 
		{ filetype: 'jpg'}, 
		function(code, message) {
			if(code == 0) {
				$.alert('上传成功');
				//$("#zhutu_img").attr('src',message.url);
				$("#image").val(message.url);
			} else {
				$.alert(message);
			}
		}, 
		function(percent) {

		}
	);
});

</script>
